{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": [
     "remove-cell"
    ]
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "if not any(path.endswith('textbook') for path in sys.path):\n",
    "    sys.path.append(os.path.abspath('../../..'))\n",
    "from textbook_utils import *          \n",
    "\n",
    "from sklearn.linear_model import LinearRegression\n",
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(ch:viz)=\n",
    "# Data Visualization\n",
    "\n",
    "As data scientists, we create data visualizations in order to understand our\n",
    "data and explain our analyses to other people. A plot should have a message, and\n",
    "it's our job to communicate this message as clearly as possible.\n",
    "\n",
    "In {numref}`Chapter %s <ch:eda>`, we connected the choice of a statistical graph to the kind of data being plotted; we also introduced many standard plots and showed how to read them.  In this chapter, we discuss the principles of effective data visualization that make it easier for our audience to grasp the message in our plot. We talk about how to choose scales for axes,\n",
    "handle large amounts of data with smoothing and aggregation, facilitate\n",
    "meaningful comparisons, incorporate study design, and add contextual information. \n",
    "We also show how to create plots using `plotly`, a popular package for plotting in Python. \n",
    "\n",
    "One tricky part about writing a chapter on data visualization is that \n",
    "software packages for visualization change all the time, so any code we display\n",
    "can quickly get out of date. Because of this, some books avoid code entirely.\n",
    "We instead strike a balance, where we cover high-level data visualization principles\n",
    "that are broadly useful. Then we separately include practical plotting code\n",
    "to implement these principles. When new software becomes available,\n",
    "readers can still use our principles to guide the creation of their visualizations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
